package com.example.rabbitmq.rabbit.many;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/8/19 22:27
 */
@Component
@Slf4j
public class Sender2 {
    @Autowired
    private AmqpTemplate rabbitTemplate;
    public void send(int i) {
        String context = "spirng boot lyh queue"+" ****** "+i;
        log.info("Sender2 : {}" , context);
        this.rabbitTemplate.convertAndSend("lyh", context);
    }

}
